import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store, { key } from './store'
import { globalRegister } from './global'



import 'bootstrap/dist/css/bootstrap.min.css'
import axios from 'axios'

// const { token } = store.state.user
axios.defaults.baseURL = 'https://www.hejiu.ren:9999/api/private/v1/'

const app = createApp(App)

app.use(globalRegister)

axios.interceptors.request.use(config => {
  config.headers.Authorization = localStorage.getItem('token')
  return config
})


app.use(store, key)
app.use(router)
app.mount('#app')

// if (token) {
//   axios.defaults.headers.common.Authorization = `Bearer ${token}`;
// }


